package com.trkj.dao.jpa;

import java.math.BigDecimal;
import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import com.trkj.pojos.CcElectornicPrescribe;

public interface CcElectornicPrescribeDAO extends CrudRepository<CcElectornicPrescribe, Long> {

	@Query("select c from CcElectornicPrescribe c  where c.eleId=?1")
	public List<CcElectornicPrescribe> queryByEleId(BigDecimal eleId);
	@Query("select c from CcElectornicPrescribe c  where c.eleId=?1 and c.drugId=?2")
	public CcElectornicPrescribe queryByEleIdandD(BigDecimal eleId,String drugId);
	
	//根据处方id查找开药详情
	@Query("select c from CcElectornicPrescribe c  where c.eleId=?1")
	public List<CcElectornicPrescribe> findAllMedDet(BigDecimal chufangId);
}
